package com.unohacha.qqj.fzdr.ui.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.qpg.superhttp.SuperHttp;
import com.qpg.superhttp.callback.SimpleCallBack;
import com.unohacha.qqj.fzdr.R;
import com.unohacha.qqj.fzdr.bean.BaseBean;
import com.unohacha.qqj.fzdr.bean.SysMessageDetial;
import com.unohacha.qqj.fzdr.util.Prefer;
import com.unohacha.qqj.mylibrary.base.BaseActivity;

import butterknife.BindView;

public class SysMessageDetialActivity extends BaseActivity {
    @BindView(R.id.common_back)
    ImageView commonBack;
    @BindView(R.id.common_title)
    TextView commonTitle;
    @BindView(R.id.common_right_image)
    ImageView commonRightImage;
    @BindView(R.id.tv_time)
    TextView tvTime;
    @BindView(R.id.tv_content)
    TextView tvContent;
    @Override
    protected int getLayoutId() {
        return R.layout.activity_sys_message_detial;
    }

    @Override
    protected void initData() {
        super.initData();
        commonTitle.setText("消息详情");
        commonBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        SuperHttp.post("api/mymessage/systemMessage")
                .addParam("token", Prefer.getInstance().getToken())
                .request(new SimpleCallBack<BaseBean<SysMessageDetial>>() {
                    @Override
                    public void onSuccess(BaseBean<SysMessageDetial> data) {

                        if(data.getCode()==1){
                            tvTime.setText(data.getData().getDate());
                            tvContent.setText(data.getData().getContent());
                        }
                    }

                    @Override
                    public void onFail(int errCode, String errMsg) {

                    }
                });
    }
}
